<template>
	<view>
		<view class="container pt10 plr30">
			<view class="article ptb30 m-hairline--bottom" v-for="(item,index) in messageLists">
				<view class="text mb20">{{item.content}}</view>
				<view class="fs26 col-9">{{$formatDatetime(item.createtime,"yyyy-mm-dd hh:ii:ss")}}</view>
			</view>
			<view class="nothing" v-if="messageListsMore.nothing">
				<image src="/static/icon/img_null.png" mode="aspectFill"></image>
				<text>暂无数据</text>
			</view>
			<view class="g-btn3-wrap"v-else>
				<view class="g-btn3"  :class="{nomore: messageListsMore.nomore == true || messageListsMore.loading == true}" @click="fetch()">{{messageListsMore.text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const util = require('@/xiluedu/util.js');
export default {
	data() {
		return {
			type:'user',
			messageLists:[],
			messageListsMore:{page:1}
		};
	},
	onLoad(options){
		this.type = options.type;
		this.fetch();
	},
	methods: {
		fetch() {
			if(this.type == 'user'){
				util.fetch(this, 'xiluedu.message/user_list', {pagesize:10}, 'messageListsMore', 'messageLists', 'data', data=>{
				
				})
			}else if(this.type == 'activity'){
				util.fetch(this, 'xiluedu.message/activity_list', {pagesize:10}, 'messageListsMore', 'messageLists', 'data', data=>{
				
				})
			}else if(this.type == 'system'){
				util.fetch(this, 'xiluedu.message/system_list', {pagesize:10}, 'messageListsMore', 'messageLists', 'data', data=>{
				
				})
			}
		    
		},
	}
};
</script>

<style scoped>
.article .img {
	display: block;
	width: 260rpx;
	height: 180rpx;
	border-radius: 20rpx;
}
.article .text {
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #333333;
	line-height: 50rpx;
}
</style>
